<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Content_RenderBlock extends Zend_View_Helper_Abstract
{
    public function renderBlock($path)
    {
        $mdlPage = new Model_Page();
        $uriObj = new Core_Uri($path);
        $pointer = $mdlPage->fetchPointer($uriObj->toArray());
        $pageObj = $mdlPage->open($pointer, $mdlPage->getDefaultLanguage());
        $namespace = $pageObj->page->namespace . '_' . $pointer;
        return $this->view->RenderContentTemplate($pageObj->page->content_template, $pageObj->content, $namespace);
    }
}